<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>添加景点</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <style th:inline="text">
        body {
            background: url("asserts/img/bg5.jpg");
        }
    </style>

</head>
<body>
<div class="container">

    <div class="jumbotron text-center" style="background: #2E2D3C">
        <h2 style="font-family: 华文新魏;color: #fcfcfc;font-size: 50px">新建推荐景点</h2>
    </div>

    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="#" class="navbar-brand" onclick="javascript:history.back(-1);">返回</a>
            </div>
            <div class="collapse navbar-collapse" id="myNavbar">
                <ul class="nav navbar-nav">
                    <!--                    <li><a href="#">页面 2</a></li>-->
                    <!--                    <li><a href="#">页面 3</a></li>-->
                </ul>
            </div>
        </div>
    </nav>

    <form th:action="@{/saveview(userid=${user.userid})}" class="form-horizontal" role="form" method="post"
          enctype="multipart/form-data" th:if="${ #strings.isEmpty(view.viewid)}">

        <div class="form-group">
            <label for="firstname" class="col-sm-2 control-label"
                   style="font-family: 幼圆;color: #2b542c;font-size: 20px">景点封面</label>
            <div class="col-sm-10">
                <input type="file" id="inputfile" name="file">
            </div>
        </div>

        <div class="form-group">
            <label for="firstname" class="col-sm-2 control-label">景点名称</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="firstname"
                       placeholder="请输入名字" name="viewname">
            </div>
        </div>
        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">所属城市</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="lastname"
                       placeholder="" name="belongcity">
            </div>
        </div>

        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">天气类型</label>
            <div class="col-sm-10">
                <select class="form-control" name="correweather">
                    <option>晴</option>
                    <option>阴</option>
                    <option>多云</option>
                    <option>小雨</option>
                    <option>中雨</option>
                    <option>大雨</option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">景点介绍</label>
            <div class="col-sm-10">
                <textarea class="form-control" rows="3" name="introduction"></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>

    <!--修改时显示-->
    <form th:action="@{/alterView(userid=${user.userid})}" class="form-horizontal" role="form" method="post"
          enctype="multipart/form-data" th:if="${not #strings.isEmpty(view.viewid)}">

        <input type="hidden" th:value="${view.viewid}" name="viewid">
        <div class="form-group">
            <label for="firstname" class="col-sm-2 control-label">景点名称</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" th:value="${view.viewname}" name="viewname">
            </div>
        </div>
        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">所属城市</label>
            <div class="col-sm-10">
                <input type="text" class="form-control"
                       th:value="${view.belongcity}" name="belongcity">
            </div>
        </div>

        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">天气类型</label>
            <div class="col-sm-10">
                <select class="form-control" name="correweather" th:value="${view.correweather}">
                    <option>晴</option>
                    <option>阴</option>
                    <option>多云</option>
                    <option>小雨</option>
                    <option>中雨</option>
                    <option>大雨</option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">景点介绍</label>
            <div class="col-sm-10">
                <textarea class="form-control" rows="3" name="introduction" th:text="${view.introduction}"></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>


</div>


</body>
</html>